/*
function f1(...props) {
	// console.log(arguments)
	console.log(props)
}
f1(1, 22, "abc")
*/

// ES6 箭头函数   () => { ... }
/*
const sum = function (a, b) {
	return a + b
}
function isOdd(num) {
	return num % 2 === 1
}
const sum = (a, b) => {
	return a + b
}
const isOdd = (num) => {
	return num % 2 === 1
}*/

// const sum = (a, b) => a + b
// console.log(sum(23, 12)) // 35

// const isOdd = (num) => num % 2 === 1
// const isOdd = (num) => num % 2 === 1
// console.log(isOdd(33))

/*
const person = function(uname = "暂无姓名") {
	return {
		name: uname,
		age: 34
	}
}
const person = (uname = "暂无姓名") => {
	return {
		name: uname,
		age: 34
	}
}*/
// 箭头函数返回对象需要放置在({})
// const person = (uname = "暂无姓名") => ({name: uname,age: 34})
// console.log(person())
// console.log(person("张三"))

/*
function fullName({ first, last }) {
	return first + " - " + last
}*/

const fullName = ({ first, last }) => first + " - " + last
console.log(fullName({ first: "lebron", last: "james" }))


































